//反选
let reverseBtn = document.querySelector('#reverseBtn');
reverseBtn.addEventListener('click', () =& gt; {
    let checkInputs = document.querySelectorAll('#dataTbody input[type=checkbox]');
    console.log(checkInputs.length);
    checkInputs.forEach((item) =& gt; { item.checked = !item.checked; });
});
//删除所选
let deleteSelectBtn = document.querySelector('#deleteSelectBtn');
deleteSelectBtn.addEventListener('click', () =& gt; {
    let checkInputs = document.querySelectorAll('#dataTbody input[type=checkbox]');
    checkInputs.forEach((item) =& gt; { if (item.checked) { let tr = item.parentNode.parentNode; dataTbody.removeChild(tr); } });
});
//修改
let empModal = document.querySelector('#empModal');
empModal.addEventListener('show.bs.modal', (event) => {
    let button = event.relatedTarget; //事件源
    //获得指定属性的值
    let dataInfo = button.getAttribute('data-bs-whatever');
    console.log(dataInfo);
});
var form = document.getElementById("myForm");
// 提交表单时，打印输入的数据并关闭模态框
form.onsubmit = function (e) {
    e.preventDefault(); // 阻止表单的默认提交行为
    console.log('Data:', form.data.value); // 打印输入的数据
    $('#myModal').modal('hide'); // 关闭模态框
}


